import pojo.Account;

/***
 * @Author 徐庶
 * @Slogan 致敬大师，致敬未来的你
 */
public class DeadLockDemo {

    public static void main(String[] args) throws Exception {
        Account zhangsan = new Account(1, "张三");
        Account lisi = new Account(2, "李四");
        new Thread(() -> {
            try {
                zhangsan.transfer(lisi, 50);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }, "t1").start();

        new Thread(() -> {
            try {
                lisi.transfer(zhangsan, 50);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }, "t2").start();

    }
}